<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>示例5</title>
</head>
<body>
    <script>
        const arr = ['张三','李四','王五']
        for (const key of arr.keys()) {
            console.log(key)
        }
        for (const elem of arr.values()) {
            console.log(elem)
        }
        for(const [index,elem] of arr.entries()){
            console.log(index,elem)
        }
    </script>
</body>
</html>